﻿@{
    ViewBag.Title = "4冲压件成品库收发存汇总表";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}

<script>
    var moduleId = $.request("moduleId");
    $(function () {
        initControl();
        gridList();
    })
    function initControl() {
        $('select').bindSelect();
        //显示台账日期
        var keyValue = $.request("keyValue");
        $.ajax({
            url: "/WareHouse/EnterWareHouse/GetInfoDocumentNum",
            data: { keyValue: keyValue },
            dataType: "json",
            async: false,
            success: function (data) {
                $("#form1").formSerialize(data);
                //var dataa =  data.Substring(0, 4);
                //alert("a");
                $("#FAccountDate").val(data);
            }
        });
    }
    function gridList() {
        var $gridList = $("#gridList");
        $("#gridList").dataGridForJson({
            url: "/VBaseData/V_CPK_44_MX_StoCPKListAcco_Mid_HZ/GetGridJson",
            height: $(window).height() - 120,
            colModel: [
            { label: '库房', name: 'IsUnit', width:80, align: 'left' },
            { label: '期初数量', name: 'FQuantity_QC', width: 80, align: 'right' },
            { label: "期初金额(元)", name: "FQuantity_QCJE", width: 90, align: 'right' },
            { label: '调整金额(元)', name: 'FQuantity_TZJE', width: 90, align: 'right' },
            { label: '入库数量', name: 'FQuantity_RK', width: 80, align: 'right' },

            { label: '入库金额(元)', name: 'FQuantity_RKJE', width: 80, align: 'right' },
            { label: '出库数量', name: 'FQuantity_CK', width: 80, align: 'right' },
            { label: '出库金额(元)', name: 'FQuantity_CKJE', width: 80, align: 'right' },
            { label: '废品数量', name: 'FQuantity_FP', width:80, align: 'right' },
            { label: '废品金额(元)', name: 'FQuantity_FPJE', width: 80, align: 'right' },

            { label: '返修数量', name: 'FQuantity_FX', width: 80, align: 'right' },
            { label: '返修金额(元)', name: 'FQuantity_FXJE', width: 80, align: 'right' },
            { label: '盘存数量', name: 'FQuantity_PC', width: 80, align: 'right' },
            { label: '盘存金额(元)', name: 'FQuantity_PCJE', width: 80, align: 'right' },
            { label: '结存数量', name: 'FQuantity_JC', width: 80, align: 'right' },

            { label: '结存金额(元)', name: 'FQuantity_JCJE', width: 90, align: 'right' },
            ],
            pager: "#gridPager",
            sortname: 'FProductionNO asc,FProCompanyNO desc',
            viewrecords: true,
            //multiselect: true,
            onSelectRow: function (rowId) {
                rowData = $gridList.jqGrid('getRowData', rowId);
                index = rowId;
                $.each(rowData, function (key, value) {
                    $("#txt" + key).val(value);
                });
            }
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: {
                    fAccountDate: $("#FAccountDate").val(),
                },
            }).trigger('reloadGrid');
        });
    }
</script>
<body>
    <div id="layout" style="height: 100%; width: 100%;">
        <form id="form1">
            <div style="padding: 12px 0 5px 0; padding-left:15px; border-bottom:1px solid #ccc;" class="line-table input-width-160">
                <div class="btn-group" style="margin-top:-9px;margin-left:20px;">
                    台账日期<br />
                    <input id="FAccountDate" name="" placeholder="" type="text" class="form-control required" onfocus="WdatePicker({ dateFmt: 'yyyyMM', isShowToday: false, isShowClear: false });" />
                    &nbsp;
                </div>
                <div class="btn-group">
                    <a id="btn_search" class="btn btn-primary center-block" onclick=""><span class="glyphicon glyphicon-search"></span> 查询</a>
                </div>
                <div class="btn-group" style="float:right;">
                    <a class="btn btn-primary center-block" onclick="$.reload()">  <span class="glyphicon glyphicon-refresh"> </span>&nbsp刷新</a>
                    <a class="btn btn-primary center-block" onclick="btn_Excel()"> <span class="glyphicon glyphicon-download"></span>&nbsp导出</a>
                    <a class="btn btn-primary center-block" onclick="btn_Print()"> <span class="glyphicon glyphicon-print">   </span>&nbsp打印</a>
                </div>
                <table></table>
            </div>
            <div class="gridPanel">
                <table id="gridList"></table>
                <div id="gridPager"></div>
            </div>
        </form>
    </div>
</body>

